//
// libLoader.hh for libLoader in /home/taitai/rtype/serveur
// 
// Made by yannis berrouag
// Login   <berrou_y@epitech.net>
// 
// Started on  Sat Jan  7 17:37:33 2012 yannis berrouag
// Last update Tue Jan 10 13:07:04 2012 yannis berrouag
//

#ifndef _LIBLOADER_HH_
#define _LIBLOADER_HH_

#include <iostream>
#include <map>
#include <string>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <sstream>
#include "monster.hh"

class libLoader {
public:
  libLoader();
  libLoader(std::string);
  ~libLoader();
  
public:
  std::map<std::string, void *> getLoaded() { return loaded ;};
  void	*getMakerFromLib(std::string lib);
  void	setLoaded(std::string key, void * value) { loaded[key] = value;};
  void	checkDir(std::string = "./");
  bool	isAlreadyLoaded(std::string lib);
  bool	isLib(std::string lib);
  void	load(std::string lib);
  std::string	getLibRealName(std::string);
  monster	*getInstance(std::string);
protected:
  std::map<std::string, void *> loaded;
  
};

#endif
